package 其他.有contains方法的类;

import java.util.*;

/**
 * 有这个contains()  方法的 类型的 ~
 * 1. String 类型
 * 2. List  类型
 * 3. HashSet 类型
 * 4. TreeSet 类型
 * 5. HashMap 类型
 * 6. TreeMap 类型
 */
public class Main {

    public static void main(String[] args) {
        //1. 字符串本身的contains() 方法
        String s = new String("dfaifj");
        boolean d = s.contains("d");
        System.out.println(d);
        //2. list 的 contains() 方法
        ArrayList<String> list = new ArrayList<>();
        boolean daf = list.contains("daf");
        //3. map contains() 方法
        HashMap<String, String> map = new HashMap<>();
        boolean containsKey = map.containsKey("sdajfa");
        boolean containsValue = map.containsValue("dfaijf");
        //4. set contains() 方法
        HashSet<Integer> set = new HashSet<>();
        boolean dfja = set.contains("dfja");
        //5.
        TreeSet<String> treeSet = new TreeSet<>();
        boolean contains = treeSet.contains("fjdai");
        //6.
        TreeMap<String, String> treeMap = new TreeMap<>();
        boolean containsKey1 = treeMap.containsKey("djfai");
        boolean containsValue1 = treeMap.containsValue("fjda");
    }

}
